package fuxi2;

public class TestSt {

    public static void main(String[] args) {
        Student[] stus=new Student[2];
        Student st1=new Student(100,"zhangsan","男",18,99);
        Student st2=new Student(101,"lisi","女",28,98);
        stus[0]=st1;
        stus[1]=st2;
        int max=0;
        int min=stus[0].sJave;
        int sum=0;
        for (int i=0;i< stus.length;i++){
            if(stus[i].sJave>max){
                max=stus[i].sJave;
            }
            if(stus[i].sJave<min){
                min=stus[i].sJave;
            }
            sum+=stus[i].sJave;
            System.out.println(stus[i]);//打印学生的信息
        }

        System.out.println("最大值为"+max);
        System.out.println("最小值为"+min);
        System.out.println("平均"+sum/stus.length);


    }
}
